#!/user/bin/env python3
# -*- coding: utf-8 -*-
"""
--------------------------------------
    Author:     JiChao_Song
    Date  :     2021/12/18 14:59
    Desc  :
--------------------------------------
"""
from person.models import OperateLog


class OperateLogService:

    def __init__(self, content: str, model: str, type: int, **kwargs):
        self.content = content
        self.model = model
        self.type = type
        self.remark = kwargs.get('remark')
        self.createId = kwargs.get('createId')
        self.creatorName = kwargs.get('creatorName')

    def save(self):
        OperateLog.objects.create(**self.__dict__)
